package com.pearl.jacksoncore.demo.databind.anno;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.annotation.JsonTypeIdResolver;

/**
 * @author TD
 * @version 1.0
 * @date 2024/3/28
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
@JsonSubTypes({
        @JsonSubTypes.Type(value = ChildClass1.class, name = "child1"),
})
@JsonTypeIdResolver(CustomTypeIdResolver.class)
public class BaseClass {

    public BaseClass(String name) {
        this.name = name;
    }

    String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
